package com.spring.xiatian.uitl;

import com.spring.xiatian.enums.ResultEnum;

/**
 * Created by Created by xiaoxia on 2017/10/05 0001 0:25.
 */
public class Result<T> {

    private Integer code;

    private String msg;

    private T data;

    public Result(){

    }

    public Result(T data){
        this.code = ResultEnum.UserEnums.SUCCESS.getCode();
        this.msg = ResultEnum.UserEnums.SUCCESS.getMsg();
        this.data =data;
    }

    public Result(Integer code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public Result(String msg){
        this.code = 9999;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
